package encrypt;

import java.io.*;

public class Encryption {

	public boolean encrypt(String path, String name, String oPath, String oName)
			throws Exception {
		File fl = new File(path + "/" + name);
		FileInputStream fis = null;
		FileOutputStream fos = null;
		try {
			fis = new FileInputStream(fl);
			int l = 0;
			fos = new FileOutputStream(oPath + "/" + oName);
			while ((l = fis.read()) != -1) {
				fos.write(~l);
			}
		} catch (Exception e) {
			return false;
		} finally {
			fos.close();
			fis.close();
		}
		fl.delete();
		return true;
	}
}
